package com.jinzhi.jzweb.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.jinzhi.common.base.CoreServiceImpl;
import com.jinzhi.jzapi.training.pojo.RecruitmentNewsVo;
import com.jinzhi.jzweb.dao.RecruitmentNewsDao;
import com.jinzhi.jzweb.domain.RecruitmentNewsDO;
import com.jinzhi.jzweb.service.RecruitmentNewsService;
import org.springframework.stereotype.Service;

import java.util.List;
import java.util.Map;

/**
 * 
 * <pre>
 * 招聘信息
 * </pre>
 * <small> 2020-02-24 21:00:11 | lance</small>
 */
@Service
public class RecruitmentNewsServiceImpl extends CoreServiceImpl<RecruitmentNewsDao, RecruitmentNewsDO> implements RecruitmentNewsService {
    @Override
    public Page<RecruitmentNewsVo> selectListPage(int current, int number, Map map,String type) {

        // 新建分页
        Page<RecruitmentNewsVo> page = new Page<RecruitmentNewsVo>(current, number);
        if(type.equals("1")){//最新
            return page.setRecords(this.baseMapper.dyGetNewList(page,map));
        }else{//热门
            return page.setRecords(this.baseMapper.dyGetHotList(page,map));
        }
    }

    @Override
    public RecruitmentNewsDO selJobDetails(Long id){
        return this.baseMapper.selJobDetails(id);
    }

    @Override
    public List<Map> listRecru() {
        return baseMapper.listRecru();
    }
}
